do not get results where release_sunset is not null#213
Conversation
WalkthroughThis PR adds a ChangesCell Type Query Update
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/org/kpmp/cellType/CellTypeRepository.java (1)
15-20:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winConfirm whether the autocomplete query should also exclude sunset records.
The PR goal is to stop returning records where
release_sunsetis not null, butfindByCellTypeContainingOrSynonymContaining(Lines 15-19) still selectsrelease_sunsetwithout anIS NULLfilter on either UNION branch. If sunset cell types should be hidden everywhere, this query may still surface them in autocomplete results. Confirm whether this is intentional or out of scope for this PR.🔍 Suggested filter if autocomplete should also exclude sunset records
- `@Query`(value = "SELECT ct.cell_type_id, ct.structure_region, ct.structure_subregion, ct.cell_type, ct.release_ver, ct.release_sunset, ct.cell_type_order, cs.synonym " + " FROM cell_type_2025 ct " - + " JOIN celltype_synonym_2025 cs ON (ct.cell_type_id = cs.cell_type_id AND cs.synonym LIKE %:searchTerm%) " - + " UNION " + " SELECT ct.cell_type_id, ct.structure_region, ct.structure_subregion, ct.cell_type, ct.release_ver, ct.release_sunset, ct.cell_type_order, cs.synonym " + " FROM cell_type_2025 ct " - + " LEFT JOIN celltype_synonym_2025 cs ON ct.cell_type_id = cs.cell_type_id " - + " WHERE ct.cell_type LIKE %:searchTerm% ", nativeQuery = true) + `@Query`(value = "SELECT ct.cell_type_id, ct.structure_region, ct.structure_subregion, ct.cell_type, ct.release_ver, ct.release_sunset, ct.cell_type_order, cs.synonym " + " FROM cell_type_2025 ct " + + " JOIN celltype_synonym_2025 cs ON (ct.cell_type_id = cs.cell_type_id AND cs.synonym LIKE %:searchTerm%) " + + " WHERE ct.release_sunset IS NULL " + + " UNION " + " SELECT ct.cell_type_id, ct.structure_region, ct.structure_subregion, ct.cell_type, ct.release_ver, ct.release_sunset, ct.cell_type_order, cs.synonym " + " FROM cell_type_2025 ct " + + " LEFT JOIN celltype_synonym_2025 cs ON ct.cell_type_id = cs.cell_type_id " + + " WHERE ct.cell_type LIKE %:searchTerm% AND ct.release_sunset IS NULL ", nativeQuery = true)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3fbf6d20-5ea8-438b-b9bc-e9a0afd9cc66
📒 Files selected for processing (1)
src/main/java/org/kpmp/cellType/CellTypeRepository.java
Summary by CodeRabbit